<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html lang="en">

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <title>LCOV - code analysis - /usr/include/boost/thread/lock_types.hpp</title>
  <link rel="stylesheet" type="text/css" href="../../../../gcov.css">
</head>

<body>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
    <tr><td class="title">LCOV - code coverage report</td></tr>
    <tr><td class="ruler"><img src="../../../../glass.png" width=3 height=3 alt=""></td></tr>

    <tr>
      <td width="100%">
        <table cellpadding=1 border=0 width="100%">
          <tr>
            <td width="10%" class="headerItem">Current view:</td>
            <td width="35%" class="headerValue"><a href="../../../../index.html">top level</a> - <a href="index.html">usr/include/boost/thread</a> - lock_types.hpp<span style="font-size: 80%;"> (source / <a href="lock_types.hpp.func-sort-c.html">functions</a>)</span></td>
            <td width="5%"></td>
            <td width="15%"></td>
            <td width="10%" class="headerCovTableHead">Hit</td>
            <td width="10%" class="headerCovTableHead">Total</td>
            <td width="15%" class="headerCovTableHead">Coverage</td>
          </tr>
          <tr>
            <td class="headerItem">Test:</td>
            <td class="headerValue">code analysis</td>
            <td></td>
            <td class="headerItem">Lines:</td>
            <td class="headerCovTableEntry">16</td>
            <td class="headerCovTableEntry">20</td>
            <td class="headerCovTableEntryMed">80.0 %</td>
          </tr>
          <tr>
            <td class="headerItem">Date:</td>
            <td class="headerValue">2020-09-11 22:50:33</td>
            <td></td>
            <td class="headerItem">Functions:</td>
            <td class="headerCovTableEntry">2</td>
            <td class="headerCovTableEntry">2</td>
            <td class="headerCovTableEntryHi">100.0 %</td>
          </tr>
          <tr>
            <td class="headerItem">Legend:</td>
            <td class="headerValueLeg">            Lines:
            <span class="coverLegendCov">hit</span>
            <span class="coverLegendNoCov">not hit</span>
</td>
            <td></td>
          </tr>
          <tr><td><img src="../../../../glass.png" width=3 height=3 alt=""></td></tr>
        </table>
      </td>
    </tr>

    <tr><td class="ruler"><img src="../../../../glass.png" width=3 height=3 alt=""></td></tr>
  </table>

  <table cellpadding=0 cellspacing=0 border=0>
    <tr>
      <td><br></td>
    </tr>
    <tr>
      <td>
<pre class="sourceHeading">          Line data    Source code</pre>
<pre class="source">
<a name="1"><span class="lineNum">       1 </span>            : // Distributed under the Boost Software License, Version 1.0. (See</a>
<span class="lineNum">       2 </span>            : // accompanying file LICENSE_1_0.txt or copy at
<span class="lineNum">       3 </span>            : // http://www.boost.org/LICENSE_1_0.txt)
<span class="lineNum">       4 </span>            : // (C) Copyright 2007 Anthony Williams
<span class="lineNum">       5 </span>            : // (C) Copyright 2011-2012 Vicente J. Botet Escriba
<span class="lineNum">       6 </span>            : 
<span class="lineNum">       7 </span>            : #ifndef BOOST_THREAD_LOCK_TYPES_HPP
<span class="lineNum">       8 </span>            : #define BOOST_THREAD_LOCK_TYPES_HPP
<span class="lineNum">       9 </span>            : 
<span class="lineNum">      10 </span>            : #include &lt;boost/thread/detail/config.hpp&gt;
<span class="lineNum">      11 </span>            : #include &lt;boost/thread/detail/move.hpp&gt;
<span class="lineNum">      12 </span>            : #include &lt;boost/thread/exceptions.hpp&gt;
<span class="lineNum">      13 </span>            : #include &lt;boost/thread/lock_options.hpp&gt;
<span class="lineNum">      14 </span>            : #include &lt;boost/thread/lockable_traits.hpp&gt;
<span class="lineNum">      15 </span>            : #if ! defined BOOST_THREAD_PROVIDES_NESTED_LOCKS
<span class="lineNum">      16 </span>            : #include &lt;boost/thread/is_locked_by_this_thread.hpp&gt;
<span class="lineNum">      17 </span>            : #endif
<span class="lineNum">      18 </span>            : #include &lt;boost/thread/thread_time.hpp&gt;
<span class="lineNum">      19 </span>            : 
<span class="lineNum">      20 </span>            : #include &lt;boost/assert.hpp&gt;
<span class="lineNum">      21 </span>            : #ifdef BOOST_THREAD_USES_CHRONO
<span class="lineNum">      22 </span>            : #include &lt;boost/chrono/time_point.hpp&gt;
<span class="lineNum">      23 </span>            : #include &lt;boost/chrono/duration.hpp&gt;
<span class="lineNum">      24 </span>            : #endif
<span class="lineNum">      25 </span>            : #include &lt;boost/detail/workaround.hpp&gt;
<span class="lineNum">      26 </span>            : 
<span class="lineNum">      27 </span>            : #include &lt;boost/config/abi_prefix.hpp&gt;
<span class="lineNum">      28 </span>            : 
<span class="lineNum">      29 </span>            : namespace boost
<span class="lineNum">      30 </span>            : {
<span class="lineNum">      31 </span>            :   struct xtime;
<span class="lineNum">      32 </span>            : 
<span class="lineNum">      33 </span>            :   template &lt;typename Mutex&gt;
<span class="lineNum">      34 </span>            :   class shared_lock;
<span class="lineNum">      35 </span>            : 
<span class="lineNum">      36 </span>            :   template &lt;typename Mutex&gt;
<span class="lineNum">      37 </span>            :   class upgrade_lock;
<span class="lineNum">      38 </span>            : 
<span class="lineNum">      39 </span>            :   template &lt;typename Mutex&gt;
<span class="lineNum">      40 </span>            :   class unique_lock;
<span class="lineNum">      41 </span>            : 
<span class="lineNum">      42 </span>            :   namespace detail
<span class="lineNum">      43 </span>            :   {
<span class="lineNum">      44 </span>            :     template &lt;typename Mutex&gt;
<span class="lineNum">      45 </span>            :     class try_lock_wrapper;
<span class="lineNum">      46 </span>            :   }
<span class="lineNum">      47 </span>            : 
<span class="lineNum">      48 </span>            : #ifdef BOOST_THREAD_NO_AUTO_DETECT_MUTEX_TYPES
<span class="lineNum">      49 </span>            :   namespace sync
<span class="lineNum">      50 </span>            :   {
<span class="lineNum">      51 </span>            :     template&lt;typename T&gt;
<span class="lineNum">      52 </span>            :     struct is_basic_lockable&lt;unique_lock&lt;T&gt; &gt;
<span class="lineNum">      53 </span>            :     {
<span class="lineNum">      54 </span>            :       BOOST_STATIC_CONSTANT(bool, value = true);
<span class="lineNum">      55 </span>            :     };
<span class="lineNum">      56 </span>            :     template&lt;typename T&gt;
<span class="lineNum">      57 </span>            :     struct is_lockable&lt;unique_lock&lt;T&gt; &gt;
<span class="lineNum">      58 </span>            :     {
<span class="lineNum">      59 </span>            :       BOOST_STATIC_CONSTANT(bool, value = true);
<span class="lineNum">      60 </span>            :     };
<span class="lineNum">      61 </span>            : 
<span class="lineNum">      62 </span>            :     template&lt;typename T&gt;
<span class="lineNum">      63 </span>            :     struct is_basic_lockable&lt;shared_lock&lt;T&gt; &gt;
<span class="lineNum">      64 </span>            :     {
<span class="lineNum">      65 </span>            :       BOOST_STATIC_CONSTANT(bool, value = true);
<span class="lineNum">      66 </span>            :     };
<span class="lineNum">      67 </span>            :     template&lt;typename T&gt;
<span class="lineNum">      68 </span>            :     struct is_lockable&lt;shared_lock&lt;T&gt; &gt;
<span class="lineNum">      69 </span>            :     {
<span class="lineNum">      70 </span>            :       BOOST_STATIC_CONSTANT(bool, value = true);
<span class="lineNum">      71 </span>            :     };
<span class="lineNum">      72 </span>            : 
<span class="lineNum">      73 </span>            :     template&lt;typename T&gt;
<span class="lineNum">      74 </span>            :     struct is_basic_lockable&lt;upgrade_lock&lt;T&gt; &gt;
<span class="lineNum">      75 </span>            :     {
<span class="lineNum">      76 </span>            :       BOOST_STATIC_CONSTANT(bool, value = true);
<span class="lineNum">      77 </span>            :     };
<span class="lineNum">      78 </span>            :     template&lt;typename T&gt;
<span class="lineNum">      79 </span>            :     struct is_lockable&lt;upgrade_lock&lt;T&gt; &gt;
<span class="lineNum">      80 </span>            :     {
<span class="lineNum">      81 </span>            :       BOOST_STATIC_CONSTANT(bool, value = true);
<span class="lineNum">      82 </span>            :     };
<span class="lineNum">      83 </span>            : 
<span class="lineNum">      84 </span>            :     template&lt;typename T&gt;
<span class="lineNum">      85 </span>            :     struct is_basic_lockable&lt;detail::try_lock_wrapper&lt;T&gt; &gt;
<span class="lineNum">      86 </span>            :     {
<span class="lineNum">      87 </span>            :       BOOST_STATIC_CONSTANT(bool, value = true);
<span class="lineNum">      88 </span>            :     };
<span class="lineNum">      89 </span>            :     template&lt;typename T&gt;
<span class="lineNum">      90 </span>            :     struct is_lockable&lt;detail::try_lock_wrapper&lt;T&gt; &gt;
<span class="lineNum">      91 </span>            :     {
<span class="lineNum">      92 </span>            :       BOOST_STATIC_CONSTANT(bool, value = true);
<span class="lineNum">      93 </span>            :     };
<span class="lineNum">      94 </span>            :   }
<span class="lineNum">      95 </span>            : #endif
<span class="lineNum">      96 </span>            : 
<span class="lineNum">      97 </span>            : 
<span class="lineNum">      98 </span>            :   template &lt;typename Mutex&gt;
<span class="lineNum">      99 </span>            :   class unique_lock
<span class="lineNum">     100 </span>            :   {
<span class="lineNum">     101 </span>            :   private:
<span class="lineNum">     102 </span>            :     Mutex* m;
<span class="lineNum">     103 </span>            :     bool is_locked;
<span class="lineNum">     104 </span>            : 
<span class="lineNum">     105 </span>            :   private:
<span class="lineNum">     106 </span>            :     explicit unique_lock(upgrade_lock&lt;Mutex&gt;&amp;);
<span class="lineNum">     107 </span>            :     unique_lock&amp; operator=(upgrade_lock&lt;Mutex&gt;&amp; other);
<span class="lineNum">     108 </span>            :   public:
<span class="lineNum">     109 </span>            :     typedef Mutex mutex_type;
<span class="lineNum">     110 </span>            :     BOOST_THREAD_MOVABLE_ONLY( unique_lock)
<span class="lineNum">     111 </span>            : 
<span class="lineNum">     112 </span>            : #if 0 // This should not be needed anymore. Use instead BOOST_THREAD_MAKE_RV_REF.
<span class="lineNum">     113 </span>            : #if BOOST_WORKAROUND(__SUNPRO_CC, &lt; 0x5100)
<span class="lineNum">     114 </span>            :     unique_lock(const volatile unique_lock&amp;);
<span class="lineNum">     115 </span>            : #endif
<span class="lineNum">     116 </span>            : #endif
<span class="lineNum">     117 </span>            :     unique_lock()BOOST_NOEXCEPT :
<span class="lineNum">     118 </span>            :     m(0),is_locked(false)
<span class="lineNum">     119 </span>            :     {}
<span class="lineNum">     120 </span>            : 
<span class="lineNum">     121 </span>            :     explicit unique_lock(Mutex&amp; m_) :
<span class="lineNum">     122 </span><span class="lineCov">      48424 :       m(&amp;m_), is_locked(false)</span>
<span class="lineNum">     123 </span>            :     {
<span class="lineNum">     124 </span><span class="lineCov">      48424 :       lock();</span>
<span class="lineNum">     125 </span>            :     }
<span class="lineNum">     126 </span>            :     unique_lock(Mutex&amp; m_, adopt_lock_t) :
<span class="lineNum">     127 </span>            :       m(&amp;m_), is_locked(true)
<span class="lineNum">     128 </span>            :     {
<span class="lineNum">     129 </span>            : #if ! defined BOOST_THREAD_PROVIDES_NESTED_LOCKS
<span class="lineNum">     130 </span>            :       BOOST_ASSERT(is_locked_by_this_thread(m));
<span class="lineNum">     131 </span>            : #endif
<span class="lineNum">     132 </span>            :     }
<span class="lineNum">     133 </span>            :     unique_lock(Mutex&amp; m_, defer_lock_t)BOOST_NOEXCEPT:
<span class="lineNum">     134 </span>            :     m(&amp;m_),is_locked(false)
<span class="lineNum">     135 </span>            :     {}
<span class="lineNum">     136 </span>            :     unique_lock(Mutex&amp; m_, try_to_lock_t) :
<span class="lineNum">     137 </span>            :       m(&amp;m_), is_locked(false)
<span class="lineNum">     138 </span>            :     {
<span class="lineNum">     139 </span>            :       try_lock();
<span class="lineNum">     140 </span>            :     }
<span class="lineNum">     141 </span>            : #if defined BOOST_THREAD_USES_DATETIME
<span class="lineNum">     142 </span>            :     template&lt;typename TimeDuration&gt;
<span class="lineNum">     143 </span>            :     unique_lock(Mutex&amp; m_,TimeDuration const&amp; target_time):
<span class="lineNum">     144 </span>            :     m(&amp;m_),is_locked(false)
<span class="lineNum">     145 </span>            :     {
<span class="lineNum">     146 </span>            :       timed_lock(target_time);
<span class="lineNum">     147 </span>            :     }
<span class="lineNum">     148 </span>            :     unique_lock(Mutex&amp; m_,system_time const&amp; target_time):
<span class="lineNum">     149 </span>            :     m(&amp;m_),is_locked(false)
<span class="lineNum">     150 </span>            :     {
<span class="lineNum">     151 </span>            :       timed_lock(target_time);
<span class="lineNum">     152 </span>            :     }
<span class="lineNum">     153 </span>            : #endif
<span class="lineNum">     154 </span>            : #ifdef BOOST_THREAD_USES_CHRONO
<span class="lineNum">     155 </span>            :     template &lt;class Clock, class Duration&gt;
<span class="lineNum">     156 </span>            :     unique_lock(Mutex&amp; mtx, const chrono::time_point&lt;Clock, Duration&gt;&amp; t)
<span class="lineNum">     157 </span>            :     : m(&amp;mtx), is_locked(mtx.try_lock_until(t))
<span class="lineNum">     158 </span>            :     {
<span class="lineNum">     159 </span>            :     }
<span class="lineNum">     160 </span>            :     template &lt;class Rep, class Period&gt;
<span class="lineNum">     161 </span>            :     unique_lock(Mutex&amp; mtx, const chrono::duration&lt;Rep, Period&gt;&amp; d)
<span class="lineNum">     162 </span>            :     : m(&amp;mtx), is_locked(mtx.try_lock_for(d))
<span class="lineNum">     163 </span>            :     {
<span class="lineNum">     164 </span>            :     }
<span class="lineNum">     165 </span>            : #endif
<span class="lineNum">     166 </span>            : 
<span class="lineNum">     167 </span>            :     unique_lock(BOOST_THREAD_RV_REF(unique_lock) other) BOOST_NOEXCEPT:
<span class="lineNum">     168 </span>            :     m(BOOST_THREAD_RV(other).m),is_locked(BOOST_THREAD_RV(other).is_locked)
<span class="lineNum">     169 </span>            :     {
<span class="lineNum">     170 </span>            :       BOOST_THREAD_RV(other).is_locked=false;
<span class="lineNum">     171 </span>            :       BOOST_THREAD_RV(other).m=0;
<span class="lineNum">     172 </span>            :     }
<span class="lineNum">     173 </span>            : 
<span class="lineNum">     174 </span>            :     BOOST_THREAD_EXPLICIT_LOCK_CONVERSION unique_lock(BOOST_THREAD_RV_REF_BEG upgrade_lock&lt;Mutex&gt; BOOST_THREAD_RV_REF_END other);
<span class="lineNum">     175 </span>            : 
<span class="lineNum">     176 </span>            : #ifndef BOOST_THREAD_PROVIDES_EXPLICIT_LOCK_CONVERSION
<span class="lineNum">     177 </span>            :     //std-2104 unique_lock move-assignment should not be noexcept
<span class="lineNum">     178 </span>            :     unique_lock&amp; operator=(BOOST_THREAD_RV_REF_BEG upgrade_lock&lt;Mutex&gt; BOOST_THREAD_RV_REF_END other) //BOOST_NOEXCEPT
<span class="lineNum">     179 </span>            :     {
<span class="lineNum">     180 </span>            :       unique_lock temp(::boost::move(other));
<span class="lineNum">     181 </span>            :       swap(temp);
<span class="lineNum">     182 </span>            :       return *this;
<span class="lineNum">     183 </span>            :     }
<span class="lineNum">     184 </span>            : #endif
<span class="lineNum">     185 </span>            : 
<span class="lineNum">     186 </span>            :     //std-2104 unique_lock move-assignment should not be noexcept
<span class="lineNum">     187 </span>            :     unique_lock&amp; operator=(BOOST_THREAD_RV_REF(unique_lock) other) //BOOST_NOEXCEPT
<span class="lineNum">     188 </span>            :     {
<span class="lineNum">     189 </span>            :       unique_lock temp(::boost::move(other));
<span class="lineNum">     190 </span>            :       swap(temp);
<span class="lineNum">     191 </span>            :       return *this;
<span class="lineNum">     192 </span>            :     }
<span class="lineNum">     193 </span>            : #if 0 // This should not be needed anymore. Use instead BOOST_THREAD_MAKE_RV_REF.
<span class="lineNum">     194 </span>            : #if BOOST_WORKAROUND(__SUNPRO_CC, &lt; 0x5100)
<span class="lineNum">     195 </span>            :     unique_lock&amp; operator=(unique_lock&lt;Mutex&gt; other)
<span class="lineNum">     196 </span>            :     {
<span class="lineNum">     197 </span>            :       swap(other);
<span class="lineNum">     198 </span>            :       return *this;
<span class="lineNum">     199 </span>            :     }
<span class="lineNum">     200 </span>            : #endif // BOOST_WORKAROUND
<span class="lineNum">     201 </span>            : #endif
<span class="lineNum">     202 </span>            : 
<span class="lineNum">     203 </span>            :     // Conversion from upgrade locking
<span class="lineNum">     204 </span>            :     unique_lock(BOOST_THREAD_RV_REF_BEG upgrade_lock&lt;mutex_type&gt; BOOST_THREAD_RV_REF_END ul, try_to_lock_t)
<span class="lineNum">     205 </span>            :     : m(0),is_locked(false)
<span class="lineNum">     206 </span>            :     {
<span class="lineNum">     207 </span>            :       if (BOOST_THREAD_RV(ul).owns_lock())
<span class="lineNum">     208 </span>            :       {
<span class="lineNum">     209 </span>            :         if (BOOST_THREAD_RV(ul).mutex()-&gt;try_unlock_upgrade_and_lock())
<span class="lineNum">     210 </span>            :         {
<span class="lineNum">     211 </span>            :           m = BOOST_THREAD_RV(ul).release();
<span class="lineNum">     212 </span>            :           is_locked = true;
<span class="lineNum">     213 </span>            :         }
<span class="lineNum">     214 </span>            :       }
<span class="lineNum">     215 </span>            :       else
<span class="lineNum">     216 </span>            :       {
<span class="lineNum">     217 </span>            :         m = BOOST_THREAD_RV(ul).release();
<span class="lineNum">     218 </span>            :       }
<span class="lineNum">     219 </span>            :     }
<span class="lineNum">     220 </span>            : 
<span class="lineNum">     221 </span>            : #ifdef BOOST_THREAD_USES_CHRONO
<span class="lineNum">     222 </span>            :     template &lt;class Clock, class Duration&gt;
<span class="lineNum">     223 </span>            :     unique_lock(BOOST_THREAD_RV_REF_BEG upgrade_lock&lt;mutex_type&gt; BOOST_THREAD_RV_REF_END ul,
<span class="lineNum">     224 </span>            :         const chrono::time_point&lt;Clock, Duration&gt;&amp; abs_time)
<span class="lineNum">     225 </span>            :     : m(0),is_locked(false)
<span class="lineNum">     226 </span>            :     {
<span class="lineNum">     227 </span>            :       if (BOOST_THREAD_RV(ul).owns_lock())
<span class="lineNum">     228 </span>            :       {
<span class="lineNum">     229 </span>            :         if (BOOST_THREAD_RV(ul).mutex()-&gt;try_unlock_upgrade_and_lock_until(abs_time))
<span class="lineNum">     230 </span>            :         {
<span class="lineNum">     231 </span>            :           m = BOOST_THREAD_RV(ul).release();
<span class="lineNum">     232 </span>            :           is_locked = true;
<span class="lineNum">     233 </span>            :         }
<span class="lineNum">     234 </span>            :       }
<span class="lineNum">     235 </span>            :       else
<span class="lineNum">     236 </span>            :       {
<span class="lineNum">     237 </span>            :         m = BOOST_THREAD_RV(ul).release();
<span class="lineNum">     238 </span>            :       }
<span class="lineNum">     239 </span>            :     }
<span class="lineNum">     240 </span>            : 
<span class="lineNum">     241 </span>            :     template &lt;class Rep, class Period&gt;
<span class="lineNum">     242 </span>            :     unique_lock(BOOST_THREAD_RV_REF_BEG upgrade_lock&lt;mutex_type&gt; BOOST_THREAD_RV_REF_END ul,
<span class="lineNum">     243 </span>            :         const chrono::duration&lt;Rep, Period&gt;&amp; rel_time)
<span class="lineNum">     244 </span>            :     : m(0),is_locked(false)
<span class="lineNum">     245 </span>            :     {
<span class="lineNum">     246 </span>            :       if (BOOST_THREAD_RV(ul).owns_lock())
<span class="lineNum">     247 </span>            :       {
<span class="lineNum">     248 </span>            :         if (BOOST_THREAD_RV(ul).mutex()-&gt;try_unlock_upgrade_and_lock_for(rel_time))
<span class="lineNum">     249 </span>            :         {
<span class="lineNum">     250 </span>            :           m = BOOST_THREAD_RV(ul).release();
<span class="lineNum">     251 </span>            :           is_locked = true;
<span class="lineNum">     252 </span>            :         }
<span class="lineNum">     253 </span>            :       }
<span class="lineNum">     254 </span>            :       else
<span class="lineNum">     255 </span>            :       {
<span class="lineNum">     256 </span>            :         m = BOOST_THREAD_RV(ul).release();
<span class="lineNum">     257 </span>            :       }
<span class="lineNum">     258 </span>            :     }
<span class="lineNum">     259 </span>            : #endif
<span class="lineNum">     260 </span>            : 
<span class="lineNum">     261 </span>            : #ifdef BOOST_THREAD_PROVIDES_SHARED_MUTEX_UPWARDS_CONVERSIONS
<span class="lineNum">     262 </span>            :     // Conversion from shared locking
<span class="lineNum">     263 </span>            :     unique_lock(BOOST_THREAD_RV_REF_BEG shared_lock&lt;mutex_type&gt; BOOST_THREAD_RV_REF_END sl, try_to_lock_t)
<span class="lineNum">     264 </span>            :     : m(0),is_locked(false)
<span class="lineNum">     265 </span>            :     {
<span class="lineNum">     266 </span>            :       if (BOOST_THREAD_RV(sl).owns_lock())
<span class="lineNum">     267 </span>            :       {
<span class="lineNum">     268 </span>            :         if (BOOST_THREAD_RV(sl).mutex()-&gt;try_unlock_shared_and_lock())
<span class="lineNum">     269 </span>            :         {
<span class="lineNum">     270 </span>            :           m = BOOST_THREAD_RV(sl).release();
<span class="lineNum">     271 </span>            :           is_locked = true;
<span class="lineNum">     272 </span>            :         }
<span class="lineNum">     273 </span>            :       }
<span class="lineNum">     274 </span>            :       else
<span class="lineNum">     275 </span>            :       {
<span class="lineNum">     276 </span>            :         m = BOOST_THREAD_RV(sl).release();
<span class="lineNum">     277 </span>            :       }
<span class="lineNum">     278 </span>            :     }
<span class="lineNum">     279 </span>            : 
<span class="lineNum">     280 </span>            : #ifdef BOOST_THREAD_USES_CHRONO
<span class="lineNum">     281 </span>            :     template &lt;class Clock, class Duration&gt;
<span class="lineNum">     282 </span>            :     unique_lock(BOOST_THREAD_RV_REF_BEG shared_lock&lt;mutex_type&gt; BOOST_THREAD_RV_REF_END sl,
<span class="lineNum">     283 </span>            :         const chrono::time_point&lt;Clock, Duration&gt;&amp; abs_time)
<span class="lineNum">     284 </span>            :     : m(0),is_locked(false)
<span class="lineNum">     285 </span>            :     {
<span class="lineNum">     286 </span>            :       if (BOOST_THREAD_RV(sl).owns_lock())
<span class="lineNum">     287 </span>            :       {
<span class="lineNum">     288 </span>            :         if (BOOST_THREAD_RV(sl).mutex()-&gt;try_unlock_shared_and_lock_until(abs_time))
<span class="lineNum">     289 </span>            :         {
<span class="lineNum">     290 </span>            :           m = BOOST_THREAD_RV(sl).release();
<span class="lineNum">     291 </span>            :           is_locked = true;
<span class="lineNum">     292 </span>            :         }
<span class="lineNum">     293 </span>            :       }
<span class="lineNum">     294 </span>            :       else
<span class="lineNum">     295 </span>            :       {
<span class="lineNum">     296 </span>            :         m = BOOST_THREAD_RV(sl).release();
<span class="lineNum">     297 </span>            :       }
<span class="lineNum">     298 </span>            :     }
<span class="lineNum">     299 </span>            : 
<span class="lineNum">     300 </span>            :     template &lt;class Rep, class Period&gt;
<span class="lineNum">     301 </span>            :     unique_lock(BOOST_THREAD_RV_REF_BEG shared_lock&lt;mutex_type&gt; BOOST_THREAD_RV_REF_END sl,
<span class="lineNum">     302 </span>            :         const chrono::duration&lt;Rep, Period&gt;&amp; rel_time)
<span class="lineNum">     303 </span>            :     : m(0),is_locked(false)
<span class="lineNum">     304 </span>            :     {
<span class="lineNum">     305 </span>            :       if (BOOST_THREAD_RV(sl).owns_lock())
<span class="lineNum">     306 </span>            :       {
<span class="lineNum">     307 </span>            :         if (BOOST_THREAD_RV(sl).mutex()-&gt;try_unlock_shared_and_lock_for(rel_time))
<span class="lineNum">     308 </span>            :         {
<span class="lineNum">     309 </span>            :           m = BOOST_THREAD_RV(sl).release();
<span class="lineNum">     310 </span>            :           is_locked = true;
<span class="lineNum">     311 </span>            :         }
<span class="lineNum">     312 </span>            :       }
<span class="lineNum">     313 </span>            :       else
<span class="lineNum">     314 </span>            :       {
<span class="lineNum">     315 </span>            :         m = BOOST_THREAD_RV(sl).release();
<span class="lineNum">     316 </span>            :       }
<span class="lineNum">     317 </span>            :     }
<span class="lineNum">     318 </span>            : #endif // BOOST_THREAD_USES_CHRONO
<span class="lineNum">     319 </span>            : #endif // BOOST_THREAD_PROVIDES_SHARED_MUTEX_UPWARDS_CONVERSIONS
<span class="lineNum">     320 </span>            : 
<span class="lineNum">     321 </span>            :     void swap(unique_lock&amp; other)BOOST_NOEXCEPT
<span class="lineNum">     322 </span>            :     {
<span class="lineNum">     323 </span>            :       std::swap(m,other.m);
<span class="lineNum">     324 </span>            :       std::swap(is_locked,other.is_locked);
<span class="lineNum">     325 </span>            :     }
<span class="lineNum">     326 </span>            : 
<span class="lineNum">     327 </span>            :     ~unique_lock()
<span class="lineNum">     328 </span>            :     {
<span class="lineNum">     329 </span><span class="lineCov">      48424 :       if (owns_lock())</span>
<span class="lineNum">     330 </span>            :       {
<span class="lineNum">     331 </span><span class="lineCov">      24210 :         m-&gt;unlock();</span>
<a name="332"><span class="lineNum">     332 </span>            :       }</a>
<span class="lineNum">     333 </span><span class="lineCov">      48424 :     }</span>
<span class="lineNum">     334 </span><span class="lineCov">      60525 :     void lock()</span>
<span class="lineNum">     335 </span>            :     {
<span class="lineNum">     336 </span><span class="lineCov">      60525 :       if (m == 0)</span>
<span class="lineNum">     337 </span>            :       {
<span class="lineNum">     338 </span><span class="lineNoCov">          0 :         boost::throw_exception(</span>
<span class="lineNum">     339 </span>            :             boost::lock_error(static_cast&lt;int&gt;(system::errc::operation_not_permitted), &quot;boost unique_lock has no mutex&quot;));
<span class="lineNum">     340 </span>            :       }
<span class="lineNum">     341 </span><span class="lineCov">      60525 :       if (owns_lock())</span>
<span class="lineNum">     342 </span>            :       {
<span class="lineNum">     343 </span><span class="lineNoCov">          0 :         boost::throw_exception(</span>
<span class="lineNum">     344 </span>            :             boost::lock_error(static_cast&lt;int&gt;(system::errc::resource_deadlock_would_occur), &quot;boost unique_lock owns already the mutex&quot;));
<span class="lineNum">     345 </span>            :       }
<span class="lineNum">     346 </span><span class="lineCov">      60525 :       m-&gt;lock();</span>
<span class="lineNum">     347 </span><span class="lineCov">      60525 :       is_locked = true;</span>
<span class="lineNum">     348 </span><span class="lineCov">      60525 :     }</span>
<span class="lineNum">     349 </span>            :     bool try_lock()
<span class="lineNum">     350 </span>            :     {
<span class="lineNum">     351 </span>            :       if (m == 0)
<span class="lineNum">     352 </span>            :       {
<span class="lineNum">     353 </span>            :         boost::throw_exception(
<span class="lineNum">     354 </span>            :             boost::lock_error(static_cast&lt;int&gt;(system::errc::operation_not_permitted), &quot;boost unique_lock has no mutex&quot;));
<span class="lineNum">     355 </span>            :       }
<span class="lineNum">     356 </span>            :       if (owns_lock())
<span class="lineNum">     357 </span>            :       {
<span class="lineNum">     358 </span>            :         boost::throw_exception(
<span class="lineNum">     359 </span>            :             boost::lock_error(static_cast&lt;int&gt;(system::errc::resource_deadlock_would_occur), &quot;boost unique_lock owns already the mutex&quot;));
<span class="lineNum">     360 </span>            :       }
<span class="lineNum">     361 </span>            :       is_locked = m-&gt;try_lock();
<span class="lineNum">     362 </span>            :       return is_locked;
<span class="lineNum">     363 </span>            :     }
<span class="lineNum">     364 </span>            : #if defined BOOST_THREAD_USES_DATETIME
<span class="lineNum">     365 </span>            :     template&lt;typename TimeDuration&gt;
<span class="lineNum">     366 </span>            :     bool timed_lock(TimeDuration const&amp; relative_time)
<span class="lineNum">     367 </span>            :     {
<span class="lineNum">     368 </span>            :       if(m==0)
<span class="lineNum">     369 </span>            :       {
<span class="lineNum">     370 </span>            :         boost::throw_exception(boost::lock_error(static_cast&lt;int&gt;(system::errc::operation_not_permitted), &quot;boost unique_lock has no mutex&quot;));
<span class="lineNum">     371 </span>            :       }
<span class="lineNum">     372 </span>            :       if(owns_lock())
<span class="lineNum">     373 </span>            :       {
<span class="lineNum">     374 </span>            :         boost::throw_exception(boost::lock_error(static_cast&lt;int&gt;(system::errc::resource_deadlock_would_occur), &quot;boost unique_lock owns already the mutex&quot;));
<span class="lineNum">     375 </span>            :       }
<span class="lineNum">     376 </span>            :       is_locked=m-&gt;timed_lock(relative_time);
<span class="lineNum">     377 </span>            :       return is_locked;
<span class="lineNum">     378 </span>            :     }
<span class="lineNum">     379 </span>            : 
<span class="lineNum">     380 </span>            :     bool timed_lock(::boost::system_time const&amp; absolute_time)
<span class="lineNum">     381 </span>            :     {
<span class="lineNum">     382 </span>            :       if(m==0)
<span class="lineNum">     383 </span>            :       {
<span class="lineNum">     384 </span>            :         boost::throw_exception(boost::lock_error(static_cast&lt;int&gt;(system::errc::operation_not_permitted), &quot;boost unique_lock has no mutex&quot;));
<span class="lineNum">     385 </span>            :       }
<span class="lineNum">     386 </span>            :       if(owns_lock())
<span class="lineNum">     387 </span>            :       {
<span class="lineNum">     388 </span>            :         boost::throw_exception(boost::lock_error(static_cast&lt;int&gt;(system::errc::resource_deadlock_would_occur), &quot;boost unique_lock owns already the mutex&quot;));
<span class="lineNum">     389 </span>            :       }
<span class="lineNum">     390 </span>            :       is_locked=m-&gt;timed_lock(absolute_time);
<span class="lineNum">     391 </span>            :       return is_locked;
<span class="lineNum">     392 </span>            :     }
<span class="lineNum">     393 </span>            :     bool timed_lock(::boost::xtime const&amp; absolute_time)
<span class="lineNum">     394 </span>            :     {
<span class="lineNum">     395 </span>            :       if(m==0)
<span class="lineNum">     396 </span>            :       {
<span class="lineNum">     397 </span>            :         boost::throw_exception(boost::lock_error(static_cast&lt;int&gt;(system::errc::operation_not_permitted), &quot;boost unique_lock has no mutex&quot;));
<span class="lineNum">     398 </span>            :       }
<span class="lineNum">     399 </span>            :       if(owns_lock())
<span class="lineNum">     400 </span>            :       {
<span class="lineNum">     401 </span>            :         boost::throw_exception(boost::lock_error(static_cast&lt;int&gt;(system::errc::resource_deadlock_would_occur), &quot;boost unique_lock owns already the mutex&quot;));
<span class="lineNum">     402 </span>            :       }
<span class="lineNum">     403 </span>            :       is_locked=m-&gt;timed_lock(absolute_time);
<span class="lineNum">     404 </span>            :       return is_locked;
<span class="lineNum">     405 </span>            :     }
<span class="lineNum">     406 </span>            : #endif
<span class="lineNum">     407 </span>            : #ifdef BOOST_THREAD_USES_CHRONO
<span class="lineNum">     408 </span>            : 
<span class="lineNum">     409 </span>            :     template &lt;class Rep, class Period&gt;
<span class="lineNum">     410 </span>            :     bool try_lock_for(const chrono::duration&lt;Rep, Period&gt;&amp; rel_time)
<span class="lineNum">     411 </span>            :     {
<span class="lineNum">     412 </span>            :       if(m==0)
<span class="lineNum">     413 </span>            :       {
<span class="lineNum">     414 </span>            :         boost::throw_exception(boost::lock_error(static_cast&lt;int&gt;(system::errc::operation_not_permitted), &quot;boost unique_lock has no mutex&quot;));
<span class="lineNum">     415 </span>            :       }
<span class="lineNum">     416 </span>            :       if(owns_lock())
<span class="lineNum">     417 </span>            :       {
<span class="lineNum">     418 </span>            :         boost::throw_exception(boost::lock_error(static_cast&lt;int&gt;(system::errc::resource_deadlock_would_occur), &quot;boost unique_lock owns already the mutex&quot;));
<span class="lineNum">     419 </span>            :       }
<span class="lineNum">     420 </span>            :       is_locked=m-&gt;try_lock_for(rel_time);
<span class="lineNum">     421 </span>            :       return is_locked;
<span class="lineNum">     422 </span>            :     }
<span class="lineNum">     423 </span>            :     template &lt;class Clock, class Duration&gt;
<span class="lineNum">     424 </span>            :     bool try_lock_until(const chrono::time_point&lt;Clock, Duration&gt;&amp; abs_time)
<span class="lineNum">     425 </span>            :     {
<span class="lineNum">     426 </span>            :       if(m==0)
<span class="lineNum">     427 </span>            :       {
<span class="lineNum">     428 </span>            :         boost::throw_exception(boost::lock_error(static_cast&lt;int&gt;(system::errc::operation_not_permitted), &quot;boost unique_lock has no mutex&quot;));
<span class="lineNum">     429 </span>            :       }
<span class="lineNum">     430 </span>            :       if(owns_lock())
<span class="lineNum">     431 </span>            :       {
<span class="lineNum">     432 </span>            :         boost::throw_exception(boost::lock_error(static_cast&lt;int&gt;(system::errc::resource_deadlock_would_occur), &quot;boost unique_lock owns already the mutex&quot;));
<span class="lineNum">     433 </span>            :       }
<span class="lineNum">     434 </span>            :       is_locked=m-&gt;try_lock_until(abs_time);
<span class="lineNum">     435 </span>            :       return is_locked;
<span class="lineNum">     436 </span>            :     }
<a name="437"><span class="lineNum">     437 </span>            : #endif</a>
<span class="lineNum">     438 </span>            : 
<span class="lineNum">     439 </span><span class="lineCov">      36315 :     void unlock()</span>
<span class="lineNum">     440 </span>            :     {
<span class="lineNum">     441 </span><span class="lineCov">      36315 :       if (m == 0)</span>
<span class="lineNum">     442 </span>            :       {
<span class="lineNum">     443 </span><span class="lineNoCov">          0 :         boost::throw_exception(</span>
<span class="lineNum">     444 </span>            :             boost::lock_error(static_cast&lt;int&gt;(system::errc::operation_not_permitted), &quot;boost unique_lock has no mutex&quot;));
<span class="lineNum">     445 </span>            :       }
<span class="lineNum">     446 </span><span class="lineCov">      36315 :       if (!owns_lock())</span>
<span class="lineNum">     447 </span>            :       {
<span class="lineNum">     448 </span><span class="lineNoCov">          0 :         boost::throw_exception(</span>
<span class="lineNum">     449 </span>            :             boost::lock_error(static_cast&lt;int&gt;(system::errc::operation_not_permitted), &quot;boost unique_lock doesn't own the mutex&quot;));
<span class="lineNum">     450 </span>            :       }
<span class="lineNum">     451 </span>            :       m-&gt;unlock();
<span class="lineNum">     452 </span><span class="lineCov">      36315 :       is_locked = false;</span>
<span class="lineNum">     453 </span><span class="lineCov">      36315 :     }</span>
<span class="lineNum">     454 </span>            : 
<span class="lineNum">     455 </span>            : #if defined(BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS)
<span class="lineNum">     456 </span>            :     typedef void (unique_lock::*bool_type)();
<span class="lineNum">     457 </span>            :     operator bool_type() const BOOST_NOEXCEPT
<span class="lineNum">     458 </span>            :     {
<span class="lineNum">     459 </span>            :       return is_locked?&amp;unique_lock::lock:0;
<span class="lineNum">     460 </span>            :     }
<span class="lineNum">     461 </span>            :     bool operator!() const BOOST_NOEXCEPT
<span class="lineNum">     462 </span>            :     {
<span class="lineNum">     463 </span>            :       return !owns_lock();
<span class="lineNum">     464 </span>            :     }
<span class="lineNum">     465 </span>            : #else
<span class="lineNum">     466 </span>            :     explicit operator bool() const BOOST_NOEXCEPT
<span class="lineNum">     467 </span>            :     {
<span class="lineNum">     468 </span>            :       return owns_lock();
<span class="lineNum">     469 </span>            :     }
<span class="lineNum">     470 </span>            : #endif
<span class="lineNum">     471 </span>            :     bool owns_lock() const BOOST_NOEXCEPT
<span class="lineNum">     472 </span>            :     {
<span class="lineNum">     473 </span>            :       return is_locked;
<span class="lineNum">     474 </span>            :     }
<span class="lineNum">     475 </span>            : 
<span class="lineNum">     476 </span>            :     Mutex* mutex() const BOOST_NOEXCEPT
<span class="lineNum">     477 </span>            :     {
<span class="lineNum">     478 </span>            :       return m;
<span class="lineNum">     479 </span>            :     }
<span class="lineNum">     480 </span>            : 
<span class="lineNum">     481 </span>            :     Mutex* release()BOOST_NOEXCEPT
<span class="lineNum">     482 </span>            :     {
<span class="lineNum">     483 </span>            :       Mutex* const res=m;
<span class="lineNum">     484 </span>            :       m=0;
<span class="lineNum">     485 </span>            :       is_locked=false;
<span class="lineNum">     486 </span>            :       return res;
<span class="lineNum">     487 </span>            :     }
<span class="lineNum">     488 </span>            : 
<span class="lineNum">     489 </span>            :     friend class shared_lock&lt;Mutex&gt; ;
<span class="lineNum">     490 </span>            :     friend class upgrade_lock&lt;Mutex&gt; ;
<span class="lineNum">     491 </span>            :   };
<span class="lineNum">     492 </span>            : 
<span class="lineNum">     493 </span>            :   template&lt;typename Mutex&gt;
<span class="lineNum">     494 </span>            :   void swap(unique_lock&lt;Mutex&gt;&amp; lhs, unique_lock&lt;Mutex&gt;&amp; rhs)
<span class="lineNum">     495 </span>            :   BOOST_NOEXCEPT
<span class="lineNum">     496 </span>            :   {
<span class="lineNum">     497 </span>            :     lhs.swap(rhs);
<span class="lineNum">     498 </span>            :   }
<span class="lineNum">     499 </span>            : 
<span class="lineNum">     500 </span>            :   BOOST_THREAD_DCL_MOVABLE_BEG(Mutex) unique_lock&lt;Mutex&gt; BOOST_THREAD_DCL_MOVABLE_END
<span class="lineNum">     501 </span>            : 
<span class="lineNum">     502 </span>            :   template&lt;typename Mutex&gt;
<span class="lineNum">     503 </span>            :   class shared_lock
<span class="lineNum">     504 </span>            :   {
<span class="lineNum">     505 </span>            :   protected:
<span class="lineNum">     506 </span>            :     Mutex* m;
<span class="lineNum">     507 </span>            :     bool is_locked;
<span class="lineNum">     508 </span>            : 
<span class="lineNum">     509 </span>            :   public:
<span class="lineNum">     510 </span>            :     typedef Mutex mutex_type;
<span class="lineNum">     511 </span>            :     BOOST_THREAD_MOVABLE_ONLY(shared_lock)
<span class="lineNum">     512 </span>            : 
<span class="lineNum">     513 </span>            :     shared_lock() BOOST_NOEXCEPT:
<span class="lineNum">     514 </span>            :     m(0),is_locked(false)
<span class="lineNum">     515 </span>            :     {}
<span class="lineNum">     516 </span>            : 
<span class="lineNum">     517 </span>            :     explicit shared_lock(Mutex&amp; m_):
<span class="lineNum">     518 </span>            :     m(&amp;m_),is_locked(false)
<span class="lineNum">     519 </span>            :     {
<span class="lineNum">     520 </span>            :       lock();
<span class="lineNum">     521 </span>            :     }
<span class="lineNum">     522 </span>            :     shared_lock(Mutex&amp; m_,adopt_lock_t):
<span class="lineNum">     523 </span>            :     m(&amp;m_),is_locked(true)
<span class="lineNum">     524 </span>            :     {
<span class="lineNum">     525 </span>            : #if ! defined BOOST_THREAD_PROVIDES_NESTED_LOCKS
<span class="lineNum">     526 </span>            :       BOOST_ASSERT(is_locked_by_this_thread(m));
<span class="lineNum">     527 </span>            : #endif
<span class="lineNum">     528 </span>            :     }
<span class="lineNum">     529 </span>            :     shared_lock(Mutex&amp; m_,defer_lock_t) BOOST_NOEXCEPT:
<span class="lineNum">     530 </span>            :     m(&amp;m_),is_locked(false)
<span class="lineNum">     531 </span>            :     {}
<span class="lineNum">     532 </span>            :     shared_lock(Mutex&amp; m_,try_to_lock_t):
<span class="lineNum">     533 </span>            :     m(&amp;m_),is_locked(false)
<span class="lineNum">     534 </span>            :     {
<span class="lineNum">     535 </span>            :       try_lock();
<span class="lineNum">     536 </span>            :     }
<span class="lineNum">     537 </span>            : #if defined BOOST_THREAD_USES_DATETIME
<span class="lineNum">     538 </span>            :     shared_lock(Mutex&amp; m_,system_time const&amp; target_time):
<span class="lineNum">     539 </span>            :     m(&amp;m_),is_locked(false)
<span class="lineNum">     540 </span>            :     {
<span class="lineNum">     541 </span>            :       timed_lock(target_time);
<span class="lineNum">     542 </span>            :     }
<span class="lineNum">     543 </span>            : #endif
<span class="lineNum">     544 </span>            : #ifdef BOOST_THREAD_USES_CHRONO
<span class="lineNum">     545 </span>            :     template &lt;class Clock, class Duration&gt;
<span class="lineNum">     546 </span>            :     shared_lock(Mutex&amp; mtx, const chrono::time_point&lt;Clock, Duration&gt;&amp; t)
<span class="lineNum">     547 </span>            :     : m(&amp;mtx), is_locked(mtx.try_lock_shared_until(t))
<span class="lineNum">     548 </span>            :     {
<span class="lineNum">     549 </span>            :     }
<span class="lineNum">     550 </span>            :     template &lt;class Rep, class Period&gt;
<span class="lineNum">     551 </span>            :     shared_lock(Mutex&amp; mtx, const chrono::duration&lt;Rep, Period&gt;&amp; d)
<span class="lineNum">     552 </span>            :     : m(&amp;mtx), is_locked(mtx.try_lock_shared_for(d))
<span class="lineNum">     553 </span>            :     {
<span class="lineNum">     554 </span>            :     }
<span class="lineNum">     555 </span>            : #endif
<span class="lineNum">     556 </span>            : 
<span class="lineNum">     557 </span>            :     shared_lock(BOOST_THREAD_RV_REF_BEG shared_lock&lt;Mutex&gt; BOOST_THREAD_RV_REF_END other) BOOST_NOEXCEPT:
<span class="lineNum">     558 </span>            :     m(BOOST_THREAD_RV(other).m),is_locked(BOOST_THREAD_RV(other).is_locked)
<span class="lineNum">     559 </span>            :     {
<span class="lineNum">     560 </span>            :       BOOST_THREAD_RV(other).is_locked=false;
<span class="lineNum">     561 </span>            :       BOOST_THREAD_RV(other).m=0;
<span class="lineNum">     562 </span>            :     }
<span class="lineNum">     563 </span>            : 
<span class="lineNum">     564 </span>            :     BOOST_THREAD_EXPLICIT_LOCK_CONVERSION shared_lock(BOOST_THREAD_RV_REF_BEG unique_lock&lt;Mutex&gt; BOOST_THREAD_RV_REF_END other):
<span class="lineNum">     565 </span>            :     m(BOOST_THREAD_RV(other).m),is_locked(BOOST_THREAD_RV(other).is_locked)
<span class="lineNum">     566 </span>            :     {
<span class="lineNum">     567 </span>            :       if(is_locked)
<span class="lineNum">     568 </span>            :       {
<span class="lineNum">     569 </span>            :         m-&gt;unlock_and_lock_shared();
<span class="lineNum">     570 </span>            :       }
<span class="lineNum">     571 </span>            :       BOOST_THREAD_RV(other).is_locked=false;
<span class="lineNum">     572 </span>            :       BOOST_THREAD_RV(other).m=0;
<span class="lineNum">     573 </span>            :     }
<span class="lineNum">     574 </span>            : 
<span class="lineNum">     575 </span>            :     BOOST_THREAD_EXPLICIT_LOCK_CONVERSION shared_lock(BOOST_THREAD_RV_REF_BEG upgrade_lock&lt;Mutex&gt; BOOST_THREAD_RV_REF_END other):
<span class="lineNum">     576 </span>            :     m(BOOST_THREAD_RV(other).m),is_locked(BOOST_THREAD_RV(other).is_locked)
<span class="lineNum">     577 </span>            :     {
<span class="lineNum">     578 </span>            :       if(is_locked)
<span class="lineNum">     579 </span>            :       {
<span class="lineNum">     580 </span>            :         m-&gt;unlock_upgrade_and_lock_shared();
<span class="lineNum">     581 </span>            :       }
<span class="lineNum">     582 </span>            :       BOOST_THREAD_RV(other).is_locked=false;
<span class="lineNum">     583 </span>            :       BOOST_THREAD_RV(other).m=0;
<span class="lineNum">     584 </span>            :     }
<span class="lineNum">     585 </span>            : 
<span class="lineNum">     586 </span>            :     //std-2104 unique_lock move-assignment should not be noexcept
<span class="lineNum">     587 </span>            :     shared_lock&amp; operator=(BOOST_THREAD_RV_REF_BEG shared_lock&lt;Mutex&gt; BOOST_THREAD_RV_REF_END other) //BOOST_NOEXCEPT
<span class="lineNum">     588 </span>            :     {
<span class="lineNum">     589 </span>            :       shared_lock temp(::boost::move(other));
<span class="lineNum">     590 </span>            :       swap(temp);
<span class="lineNum">     591 </span>            :       return *this;
<span class="lineNum">     592 </span>            :     }
<span class="lineNum">     593 </span>            : #ifndef BOOST_THREAD_PROVIDES_EXPLICIT_LOCK_CONVERSION
<span class="lineNum">     594 </span>            :     shared_lock&amp; operator=(BOOST_THREAD_RV_REF_BEG unique_lock&lt;Mutex&gt; BOOST_THREAD_RV_REF_END other)
<span class="lineNum">     595 </span>            :     {
<span class="lineNum">     596 </span>            :       shared_lock temp(::boost::move(other));
<span class="lineNum">     597 </span>            :       swap(temp);
<span class="lineNum">     598 </span>            :       return *this;
<span class="lineNum">     599 </span>            :     }
<span class="lineNum">     600 </span>            : 
<span class="lineNum">     601 </span>            :     shared_lock&amp; operator=(BOOST_THREAD_RV_REF_BEG upgrade_lock&lt;Mutex&gt; BOOST_THREAD_RV_REF_END other)
<span class="lineNum">     602 </span>            :     {
<span class="lineNum">     603 </span>            :       shared_lock temp(::boost::move(other));
<span class="lineNum">     604 </span>            :       swap(temp);
<span class="lineNum">     605 </span>            :       return *this;
<span class="lineNum">     606 </span>            :     }
<span class="lineNum">     607 </span>            : #endif
<span class="lineNum">     608 </span>            : 
<span class="lineNum">     609 </span>            :     void swap(shared_lock&amp; other) BOOST_NOEXCEPT
<span class="lineNum">     610 </span>            :     {
<span class="lineNum">     611 </span>            :       std::swap(m,other.m);
<span class="lineNum">     612 </span>            :       std::swap(is_locked,other.is_locked);
<span class="lineNum">     613 </span>            :     }
<span class="lineNum">     614 </span>            : 
<span class="lineNum">     615 </span>            :     Mutex* mutex() const BOOST_NOEXCEPT
<span class="lineNum">     616 </span>            :     {
<span class="lineNum">     617 </span>            :       return m;
<span class="lineNum">     618 </span>            :     }
<span class="lineNum">     619 </span>            : 
<span class="lineNum">     620 </span>            :     Mutex* release() BOOST_NOEXCEPT
<span class="lineNum">     621 </span>            :     {
<span class="lineNum">     622 </span>            :       Mutex* const res=m;
<span class="lineNum">     623 </span>            :       m=0;
<span class="lineNum">     624 </span>            :       is_locked=false;
<span class="lineNum">     625 </span>            :       return res;
<span class="lineNum">     626 </span>            :     }
<span class="lineNum">     627 </span>            : 
<span class="lineNum">     628 </span>            :     ~shared_lock()
<span class="lineNum">     629 </span>            :     {
<span class="lineNum">     630 </span>            :       if(owns_lock())
<span class="lineNum">     631 </span>            :       {
<span class="lineNum">     632 </span>            :         m-&gt;unlock_shared();
<span class="lineNum">     633 </span>            :       }
<span class="lineNum">     634 </span>            :     }
<span class="lineNum">     635 </span>            :     void lock()
<span class="lineNum">     636 </span>            :     {
<span class="lineNum">     637 </span>            :       if(m==0)
<span class="lineNum">     638 </span>            :       {
<span class="lineNum">     639 </span>            :         boost::throw_exception(boost::lock_error(static_cast&lt;int&gt;(system::errc::operation_not_permitted), &quot;boost shared_lock has no mutex&quot;));
<span class="lineNum">     640 </span>            :       }
<span class="lineNum">     641 </span>            :       if(owns_lock())
<span class="lineNum">     642 </span>            :       {
<span class="lineNum">     643 </span>            :         boost::throw_exception(boost::lock_error(static_cast&lt;int&gt;(system::errc::resource_deadlock_would_occur), &quot;boost shared_lock owns already the mutex&quot;));
<span class="lineNum">     644 </span>            :       }
<span class="lineNum">     645 </span>            :       m-&gt;lock_shared();
<span class="lineNum">     646 </span>            :       is_locked=true;
<span class="lineNum">     647 </span>            :     }
<span class="lineNum">     648 </span>            :     bool try_lock()
<span class="lineNum">     649 </span>            :     {
<span class="lineNum">     650 </span>            :       if(m==0)
<span class="lineNum">     651 </span>            :       {
<span class="lineNum">     652 </span>            :         boost::throw_exception(boost::lock_error(static_cast&lt;int&gt;(system::errc::operation_not_permitted), &quot;boost shared_lock has no mutex&quot;));
<span class="lineNum">     653 </span>            :       }
<span class="lineNum">     654 </span>            :       if(owns_lock())
<span class="lineNum">     655 </span>            :       {
<span class="lineNum">     656 </span>            :         boost::throw_exception(boost::lock_error(static_cast&lt;int&gt;(system::errc::resource_deadlock_would_occur), &quot;boost shared_lock owns already the mutex&quot;));
<span class="lineNum">     657 </span>            :       }
<span class="lineNum">     658 </span>            :       is_locked=m-&gt;try_lock_shared();
<span class="lineNum">     659 </span>            :       return is_locked;
<span class="lineNum">     660 </span>            :     }
<span class="lineNum">     661 </span>            : #if defined BOOST_THREAD_USES_DATETIME
<span class="lineNum">     662 </span>            :     bool timed_lock(boost::system_time const&amp; target_time)
<span class="lineNum">     663 </span>            :     {
<span class="lineNum">     664 </span>            :       if(m==0)
<span class="lineNum">     665 </span>            :       {
<span class="lineNum">     666 </span>            :         boost::throw_exception(boost::lock_error(static_cast&lt;int&gt;(system::errc::operation_not_permitted), &quot;boost shared_lock has no mutex&quot;));
<span class="lineNum">     667 </span>            :       }
<span class="lineNum">     668 </span>            :       if(owns_lock())
<span class="lineNum">     669 </span>            :       {
<span class="lineNum">     670 </span>            :         boost::throw_exception(boost::lock_error(static_cast&lt;int&gt;(system::errc::resource_deadlock_would_occur), &quot;boost shared_lock owns already the mutex&quot;));
<span class="lineNum">     671 </span>            :       }
<span class="lineNum">     672 </span>            :       is_locked=m-&gt;timed_lock_shared(target_time);
<span class="lineNum">     673 </span>            :       return is_locked;
<span class="lineNum">     674 </span>            :     }
<span class="lineNum">     675 </span>            :     template&lt;typename Duration&gt;
<span class="lineNum">     676 </span>            :     bool timed_lock(Duration const&amp; target_time)
<span class="lineNum">     677 </span>            :     {
<span class="lineNum">     678 </span>            :       if(m==0)
<span class="lineNum">     679 </span>            :       {
<span class="lineNum">     680 </span>            :         boost::throw_exception(boost::lock_error(static_cast&lt;int&gt;(system::errc::operation_not_permitted), &quot;boost shared_lock has no mutex&quot;));
<span class="lineNum">     681 </span>            :       }
<span class="lineNum">     682 </span>            :       if(owns_lock())
<span class="lineNum">     683 </span>            :       {
<span class="lineNum">     684 </span>            :         boost::throw_exception(boost::lock_error(static_cast&lt;int&gt;(system::errc::resource_deadlock_would_occur), &quot;boost shared_lock owns already the mutex&quot;));
<span class="lineNum">     685 </span>            :       }
<span class="lineNum">     686 </span>            :       is_locked=m-&gt;timed_lock_shared(target_time);
<span class="lineNum">     687 </span>            :       return is_locked;
<span class="lineNum">     688 </span>            :     }
<span class="lineNum">     689 </span>            : #endif
<span class="lineNum">     690 </span>            : #ifdef BOOST_THREAD_USES_CHRONO
<span class="lineNum">     691 </span>            :     template &lt;class Rep, class Period&gt;
<span class="lineNum">     692 </span>            :     bool try_lock_for(const chrono::duration&lt;Rep, Period&gt;&amp; rel_time)
<span class="lineNum">     693 </span>            :     {
<span class="lineNum">     694 </span>            :       if(m==0)
<span class="lineNum">     695 </span>            :       {
<span class="lineNum">     696 </span>            :         boost::throw_exception(boost::lock_error(static_cast&lt;int&gt;(system::errc::operation_not_permitted), &quot;boost shared_lock has no mutex&quot;));
<span class="lineNum">     697 </span>            :       }
<span class="lineNum">     698 </span>            :       if(owns_lock())
<span class="lineNum">     699 </span>            :       {
<span class="lineNum">     700 </span>            :         boost::throw_exception(boost::lock_error(static_cast&lt;int&gt;(system::errc::resource_deadlock_would_occur), &quot;boost shared_lock owns already the mutex&quot;));
<span class="lineNum">     701 </span>            :       }
<span class="lineNum">     702 </span>            :       is_locked=m-&gt;try_lock_shared_for(rel_time);
<span class="lineNum">     703 </span>            :       return is_locked;
<span class="lineNum">     704 </span>            :     }
<span class="lineNum">     705 </span>            :     template &lt;class Clock, class Duration&gt;
<span class="lineNum">     706 </span>            :     bool try_lock_until(const chrono::time_point&lt;Clock, Duration&gt;&amp; abs_time)
<span class="lineNum">     707 </span>            :     {
<span class="lineNum">     708 </span>            :       if(m==0)
<span class="lineNum">     709 </span>            :       {
<span class="lineNum">     710 </span>            :         boost::throw_exception(boost::lock_error(static_cast&lt;int&gt;(system::errc::operation_not_permitted), &quot;boost shared_lock has no mutex&quot;));
<span class="lineNum">     711 </span>            :       }
<span class="lineNum">     712 </span>            :       if(owns_lock())
<span class="lineNum">     713 </span>            :       {
<span class="lineNum">     714 </span>            :         boost::throw_exception(boost::lock_error(static_cast&lt;int&gt;(system::errc::resource_deadlock_would_occur), &quot;boost shared_lock owns already the mutex&quot;));
<span class="lineNum">     715 </span>            :       }
<span class="lineNum">     716 </span>            :       is_locked=m-&gt;try_lock_shared_until(abs_time);
<span class="lineNum">     717 </span>            :       return is_locked;
<span class="lineNum">     718 </span>            :     }
<span class="lineNum">     719 </span>            : #endif
<span class="lineNum">     720 </span>            :     void unlock()
<span class="lineNum">     721 </span>            :     {
<span class="lineNum">     722 </span>            :       if(m==0)
<span class="lineNum">     723 </span>            :       {
<span class="lineNum">     724 </span>            :         boost::throw_exception(boost::lock_error(static_cast&lt;int&gt;(system::errc::operation_not_permitted), &quot;boost shared_lock has no mutex&quot;));
<span class="lineNum">     725 </span>            :       }
<span class="lineNum">     726 </span>            :       if(!owns_lock())
<span class="lineNum">     727 </span>            :       {
<span class="lineNum">     728 </span>            :         boost::throw_exception(boost::lock_error(static_cast&lt;int&gt;(system::errc::operation_not_permitted), &quot;boost shared_lock doesn't own the mutex&quot;));
<span class="lineNum">     729 </span>            :       }
<span class="lineNum">     730 </span>            :       m-&gt;unlock_shared();
<span class="lineNum">     731 </span>            :       is_locked=false;
<span class="lineNum">     732 </span>            :     }
<span class="lineNum">     733 </span>            : 
<span class="lineNum">     734 </span>            : #if defined(BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS)
<span class="lineNum">     735 </span>            :     typedef void (shared_lock&lt;Mutex&gt;::*bool_type)();
<span class="lineNum">     736 </span>            :     operator bool_type() const BOOST_NOEXCEPT
<span class="lineNum">     737 </span>            :     {
<span class="lineNum">     738 </span>            :       return is_locked?&amp;shared_lock::lock:0;
<span class="lineNum">     739 </span>            :     }
<span class="lineNum">     740 </span>            :     bool operator!() const BOOST_NOEXCEPT
<span class="lineNum">     741 </span>            :     {
<span class="lineNum">     742 </span>            :       return !owns_lock();
<span class="lineNum">     743 </span>            :     }
<span class="lineNum">     744 </span>            : #else
<span class="lineNum">     745 </span>            :     explicit operator bool() const BOOST_NOEXCEPT
<span class="lineNum">     746 </span>            :     {
<span class="lineNum">     747 </span>            :       return owns_lock();
<span class="lineNum">     748 </span>            :     }
<span class="lineNum">     749 </span>            : #endif
<span class="lineNum">     750 </span>            :     bool owns_lock() const BOOST_NOEXCEPT
<span class="lineNum">     751 </span>            :     {
<span class="lineNum">     752 </span>            :       return is_locked;
<span class="lineNum">     753 </span>            :     }
<span class="lineNum">     754 </span>            : 
<span class="lineNum">     755 </span>            :   };
<span class="lineNum">     756 </span>            : 
<span class="lineNum">     757 </span>            :   BOOST_THREAD_DCL_MOVABLE_BEG(Mutex) shared_lock&lt;Mutex&gt; BOOST_THREAD_DCL_MOVABLE_END
<span class="lineNum">     758 </span>            : 
<span class="lineNum">     759 </span>            :   template&lt;typename Mutex&gt;
<span class="lineNum">     760 </span>            :   void swap(shared_lock&lt;Mutex&gt;&amp; lhs,shared_lock&lt;Mutex&gt;&amp; rhs) BOOST_NOEXCEPT
<span class="lineNum">     761 </span>            :   {
<span class="lineNum">     762 </span>            :     lhs.swap(rhs);
<span class="lineNum">     763 </span>            :   }
<span class="lineNum">     764 </span>            : 
<span class="lineNum">     765 </span>            :   template &lt;typename Mutex&gt;
<span class="lineNum">     766 </span>            :   class upgrade_lock
<span class="lineNum">     767 </span>            :   {
<span class="lineNum">     768 </span>            :   protected:
<span class="lineNum">     769 </span>            :     Mutex* m;
<span class="lineNum">     770 </span>            :     bool is_locked;
<span class="lineNum">     771 </span>            : 
<span class="lineNum">     772 </span>            :   public:
<span class="lineNum">     773 </span>            :     typedef Mutex mutex_type;
<span class="lineNum">     774 </span>            :     BOOST_THREAD_MOVABLE_ONLY( upgrade_lock)
<span class="lineNum">     775 </span>            : 
<span class="lineNum">     776 </span>            :     upgrade_lock()BOOST_NOEXCEPT:
<span class="lineNum">     777 </span>            :     m(0),is_locked(false)
<span class="lineNum">     778 </span>            :     {}
<span class="lineNum">     779 </span>            : 
<span class="lineNum">     780 </span>            :     explicit upgrade_lock(Mutex&amp; m_) :
<span class="lineNum">     781 </span>            :       m(&amp;m_), is_locked(false)
<span class="lineNum">     782 </span>            :     {
<span class="lineNum">     783 </span>            :       lock();
<span class="lineNum">     784 </span>            :     }
<span class="lineNum">     785 </span>            :     upgrade_lock(Mutex&amp; m_, adopt_lock_t) :
<span class="lineNum">     786 </span>            :       m(&amp;m_), is_locked(true)
<span class="lineNum">     787 </span>            :     {
<span class="lineNum">     788 </span>            : #if ! defined BOOST_THREAD_PROVIDES_NESTED_LOCKS
<span class="lineNum">     789 </span>            :       BOOST_ASSERT(is_locked_by_this_thread(m));
<span class="lineNum">     790 </span>            : #endif
<span class="lineNum">     791 </span>            :     }
<span class="lineNum">     792 </span>            :     upgrade_lock(Mutex&amp; m_, defer_lock_t)BOOST_NOEXCEPT:
<span class="lineNum">     793 </span>            :     m(&amp;m_),is_locked(false)
<span class="lineNum">     794 </span>            :     {}
<span class="lineNum">     795 </span>            :     upgrade_lock(Mutex&amp; m_, try_to_lock_t) :
<span class="lineNum">     796 </span>            :       m(&amp;m_), is_locked(false)
<span class="lineNum">     797 </span>            :     {
<span class="lineNum">     798 </span>            :       try_lock();
<span class="lineNum">     799 </span>            :     }
<span class="lineNum">     800 </span>            : 
<span class="lineNum">     801 </span>            : #ifdef BOOST_THREAD_USES_CHRONO
<span class="lineNum">     802 </span>            :     template &lt;class Clock, class Duration&gt;
<span class="lineNum">     803 </span>            :     upgrade_lock(Mutex&amp; mtx, const chrono::time_point&lt;Clock, Duration&gt;&amp; t)
<span class="lineNum">     804 </span>            :     : m(&amp;mtx), is_locked(mtx.try_lock_upgrade_until(t))
<span class="lineNum">     805 </span>            :     {
<span class="lineNum">     806 </span>            :     }
<span class="lineNum">     807 </span>            :     template &lt;class Rep, class Period&gt;
<span class="lineNum">     808 </span>            :     upgrade_lock(Mutex&amp; mtx, const chrono::duration&lt;Rep, Period&gt;&amp; d)
<span class="lineNum">     809 </span>            :     : m(&amp;mtx), is_locked(mtx.try_lock_upgrade_for(d))
<span class="lineNum">     810 </span>            :     {
<span class="lineNum">     811 </span>            :     }
<span class="lineNum">     812 </span>            : #endif
<span class="lineNum">     813 </span>            : 
<span class="lineNum">     814 </span>            :     upgrade_lock(BOOST_THREAD_RV_REF_BEG upgrade_lock&lt;Mutex&gt; BOOST_THREAD_RV_REF_END other) BOOST_NOEXCEPT:
<span class="lineNum">     815 </span>            :     m(BOOST_THREAD_RV(other).m),is_locked(BOOST_THREAD_RV(other).is_locked)
<span class="lineNum">     816 </span>            :     {
<span class="lineNum">     817 </span>            :       BOOST_THREAD_RV(other).is_locked=false;
<span class="lineNum">     818 </span>            :       BOOST_THREAD_RV(other).m=0;
<span class="lineNum">     819 </span>            :     }
<span class="lineNum">     820 </span>            : 
<span class="lineNum">     821 </span>            :     BOOST_THREAD_EXPLICIT_LOCK_CONVERSION upgrade_lock(BOOST_THREAD_RV_REF_BEG unique_lock&lt;Mutex&gt; BOOST_THREAD_RV_REF_END other):
<span class="lineNum">     822 </span>            :     m(BOOST_THREAD_RV(other).m),is_locked(BOOST_THREAD_RV(other).is_locked)
<span class="lineNum">     823 </span>            :     {
<span class="lineNum">     824 </span>            :       if(is_locked)
<span class="lineNum">     825 </span>            :       {
<span class="lineNum">     826 </span>            :         m-&gt;unlock_and_lock_upgrade();
<span class="lineNum">     827 </span>            :       }
<span class="lineNum">     828 </span>            :       BOOST_THREAD_RV(other).is_locked=false;
<span class="lineNum">     829 </span>            :       BOOST_THREAD_RV(other).m=0;
<span class="lineNum">     830 </span>            :     }
<span class="lineNum">     831 </span>            : 
<span class="lineNum">     832 </span>            :     //std-2104 unique_lock move-assignment should not be noexcept
<span class="lineNum">     833 </span>            :     upgrade_lock&amp; operator=(BOOST_THREAD_RV_REF_BEG upgrade_lock&lt;Mutex&gt; BOOST_THREAD_RV_REF_END other) //BOOST_NOEXCEPT
<span class="lineNum">     834 </span>            :     {
<span class="lineNum">     835 </span>            :       upgrade_lock temp(::boost::move(other));
<span class="lineNum">     836 </span>            :       swap(temp);
<span class="lineNum">     837 </span>            :       return *this;
<span class="lineNum">     838 </span>            :     }
<span class="lineNum">     839 </span>            : 
<span class="lineNum">     840 </span>            : #ifndef BOOST_THREAD_PROVIDES_EXPLICIT_LOCK_CONVERSION
<span class="lineNum">     841 </span>            :     upgrade_lock&amp; operator=(BOOST_THREAD_RV_REF_BEG unique_lock&lt;Mutex&gt; BOOST_THREAD_RV_REF_END other)
<span class="lineNum">     842 </span>            :     {
<span class="lineNum">     843 </span>            :       upgrade_lock temp(::boost::move(other));
<span class="lineNum">     844 </span>            :       swap(temp);
<span class="lineNum">     845 </span>            :       return *this;
<span class="lineNum">     846 </span>            :     }
<span class="lineNum">     847 </span>            : #endif
<span class="lineNum">     848 </span>            : 
<span class="lineNum">     849 </span>            : #ifdef BOOST_THREAD_PROVIDES_SHARED_MUTEX_UPWARDS_CONVERSIONS
<span class="lineNum">     850 </span>            :     // Conversion from shared locking
<span class="lineNum">     851 </span>            :     upgrade_lock(BOOST_THREAD_RV_REF_BEG shared_lock&lt;mutex_type&gt; BOOST_THREAD_RV_REF_END sl, try_to_lock_t)
<span class="lineNum">     852 </span>            :     : m(0),is_locked(false)
<span class="lineNum">     853 </span>            :     {
<span class="lineNum">     854 </span>            :       if (BOOST_THREAD_RV(sl).owns_lock())
<span class="lineNum">     855 </span>            :       {
<span class="lineNum">     856 </span>            :         if (BOOST_THREAD_RV(sl).mutex()-&gt;try_unlock_shared_and_lock_upgrade())
<span class="lineNum">     857 </span>            :         {
<span class="lineNum">     858 </span>            :           m = BOOST_THREAD_RV(sl).release();
<span class="lineNum">     859 </span>            :           is_locked = true;
<span class="lineNum">     860 </span>            :         }
<span class="lineNum">     861 </span>            :       }
<span class="lineNum">     862 </span>            :       else
<span class="lineNum">     863 </span>            :       {
<span class="lineNum">     864 </span>            :         m = BOOST_THREAD_RV(sl).release();
<span class="lineNum">     865 </span>            :       }
<span class="lineNum">     866 </span>            :     }
<span class="lineNum">     867 </span>            : 
<span class="lineNum">     868 </span>            : #ifdef BOOST_THREAD_USES_CHRONO
<span class="lineNum">     869 </span>            :     template &lt;class Clock, class Duration&gt;
<span class="lineNum">     870 </span>            :     upgrade_lock(BOOST_THREAD_RV_REF_BEG shared_lock&lt;mutex_type&gt; BOOST_THREAD_RV_REF_END sl,
<span class="lineNum">     871 </span>            :         const chrono::time_point&lt;Clock, Duration&gt;&amp; abs_time)
<span class="lineNum">     872 </span>            :     : m(0),is_locked(false)
<span class="lineNum">     873 </span>            :     {
<span class="lineNum">     874 </span>            :       if (BOOST_THREAD_RV(sl).owns_lock())
<span class="lineNum">     875 </span>            :       {
<span class="lineNum">     876 </span>            :         if (BOOST_THREAD_RV(sl).mutex()-&gt;try_unlock_shared_and_lock_upgrade_until(abs_time))
<span class="lineNum">     877 </span>            :         {
<span class="lineNum">     878 </span>            :           m = BOOST_THREAD_RV(sl).release();
<span class="lineNum">     879 </span>            :           is_locked = true;
<span class="lineNum">     880 </span>            :         }
<span class="lineNum">     881 </span>            :       }
<span class="lineNum">     882 </span>            :       else
<span class="lineNum">     883 </span>            :       {
<span class="lineNum">     884 </span>            :         m = BOOST_THREAD_RV(sl).release();
<span class="lineNum">     885 </span>            :       }
<span class="lineNum">     886 </span>            :     }
<span class="lineNum">     887 </span>            : 
<span class="lineNum">     888 </span>            :     template &lt;class Rep, class Period&gt;
<span class="lineNum">     889 </span>            :     upgrade_lock(BOOST_THREAD_RV_REF_BEG shared_lock&lt;mutex_type&gt; BOOST_THREAD_RV_REF_END sl,
<span class="lineNum">     890 </span>            :         const chrono::duration&lt;Rep, Period&gt;&amp; rel_time)
<span class="lineNum">     891 </span>            :     : m(0),is_locked(false)
<span class="lineNum">     892 </span>            :     {
<span class="lineNum">     893 </span>            :       if (BOOST_THREAD_RV(sl).owns_lock())
<span class="lineNum">     894 </span>            :       {
<span class="lineNum">     895 </span>            :         if (BOOST_THREAD_RV(sl).mutex()-&gt;try_unlock_shared_and_lock_upgrade_for(rel_time))
<span class="lineNum">     896 </span>            :         {
<span class="lineNum">     897 </span>            :           m = BOOST_THREAD_RV(sl).release();
<span class="lineNum">     898 </span>            :           is_locked = true;
<span class="lineNum">     899 </span>            :         }
<span class="lineNum">     900 </span>            :       }
<span class="lineNum">     901 </span>            :       else
<span class="lineNum">     902 </span>            :       {
<span class="lineNum">     903 </span>            :         m = BOOST_THREAD_RV(sl).release();
<span class="lineNum">     904 </span>            :       }
<span class="lineNum">     905 </span>            :     }
<span class="lineNum">     906 </span>            : #endif // BOOST_THREAD_USES_CHRONO
<span class="lineNum">     907 </span>            : #endif // BOOST_THREAD_PROVIDES_SHARED_MUTEX_UPWARDS_CONVERSIONS
<span class="lineNum">     908 </span>            :     void swap(upgrade_lock&amp; other)BOOST_NOEXCEPT
<span class="lineNum">     909 </span>            :     {
<span class="lineNum">     910 </span>            :       std::swap(m,other.m);
<span class="lineNum">     911 </span>            :       std::swap(is_locked,other.is_locked);
<span class="lineNum">     912 </span>            :     }
<span class="lineNum">     913 </span>            :     Mutex* mutex() const BOOST_NOEXCEPT
<span class="lineNum">     914 </span>            :     {
<span class="lineNum">     915 </span>            :       return m;
<span class="lineNum">     916 </span>            :     }
<span class="lineNum">     917 </span>            : 
<span class="lineNum">     918 </span>            :     Mutex* release()BOOST_NOEXCEPT
<span class="lineNum">     919 </span>            :     {
<span class="lineNum">     920 </span>            :       Mutex* const res=m;
<span class="lineNum">     921 </span>            :       m=0;
<span class="lineNum">     922 </span>            :       is_locked=false;
<span class="lineNum">     923 </span>            :       return res;
<span class="lineNum">     924 </span>            :     }
<span class="lineNum">     925 </span>            :     ~upgrade_lock()
<span class="lineNum">     926 </span>            :     {
<span class="lineNum">     927 </span>            :       if (owns_lock())
<span class="lineNum">     928 </span>            :       {
<span class="lineNum">     929 </span>            :         m-&gt;unlock_upgrade();
<span class="lineNum">     930 </span>            :       }
<span class="lineNum">     931 </span>            :     }
<span class="lineNum">     932 </span>            :     void lock()
<span class="lineNum">     933 </span>            :     {
<span class="lineNum">     934 </span>            :       if (m == 0)
<span class="lineNum">     935 </span>            :       {
<span class="lineNum">     936 </span>            :         boost::throw_exception(
<span class="lineNum">     937 </span>            :             boost::lock_error(static_cast&lt;int&gt;(system::errc::operation_not_permitted), &quot;boost shared_lock has no mutex&quot;));
<span class="lineNum">     938 </span>            :       }
<span class="lineNum">     939 </span>            :       if (owns_lock())
<span class="lineNum">     940 </span>            :       {
<span class="lineNum">     941 </span>            :         boost::throw_exception(
<span class="lineNum">     942 </span>            :             boost::lock_error(static_cast&lt;int&gt;(system::errc::resource_deadlock_would_occur), &quot;boost upgrade_lock owns already the mutex&quot;));
<span class="lineNum">     943 </span>            :       }
<span class="lineNum">     944 </span>            :       m-&gt;lock_upgrade();
<span class="lineNum">     945 </span>            :       is_locked = true;
<span class="lineNum">     946 </span>            :     }
<span class="lineNum">     947 </span>            :     bool try_lock()
<span class="lineNum">     948 </span>            :     {
<span class="lineNum">     949 </span>            :       if (m == 0)
<span class="lineNum">     950 </span>            :       {
<span class="lineNum">     951 </span>            :         boost::throw_exception(
<span class="lineNum">     952 </span>            :             boost::lock_error(static_cast&lt;int&gt;(system::errc::operation_not_permitted), &quot;boost shared_lock has no mutex&quot;));
<span class="lineNum">     953 </span>            :       }
<span class="lineNum">     954 </span>            :       if (owns_lock())
<span class="lineNum">     955 </span>            :       {
<span class="lineNum">     956 </span>            :         boost::throw_exception(
<span class="lineNum">     957 </span>            :             boost::lock_error(static_cast&lt;int&gt;(system::errc::resource_deadlock_would_occur), &quot;boost upgrade_lock owns already the mutex&quot;));
<span class="lineNum">     958 </span>            :       }
<span class="lineNum">     959 </span>            :       is_locked = m-&gt;try_lock_upgrade();
<span class="lineNum">     960 </span>            :       return is_locked;
<span class="lineNum">     961 </span>            :     }
<span class="lineNum">     962 </span>            :     void unlock()
<span class="lineNum">     963 </span>            :     {
<span class="lineNum">     964 </span>            :       if (m == 0)
<span class="lineNum">     965 </span>            :       {
<span class="lineNum">     966 </span>            :         boost::throw_exception(
<span class="lineNum">     967 </span>            :             boost::lock_error(static_cast&lt;int&gt;(system::errc::operation_not_permitted), &quot;boost shared_lock has no mutex&quot;));
<span class="lineNum">     968 </span>            :       }
<span class="lineNum">     969 </span>            :       if (!owns_lock())
<span class="lineNum">     970 </span>            :       {
<span class="lineNum">     971 </span>            :         boost::throw_exception(
<span class="lineNum">     972 </span>            :             boost::lock_error(static_cast&lt;int&gt;(system::errc::operation_not_permitted), &quot;boost upgrade_lock doesn't own the mutex&quot;));
<span class="lineNum">     973 </span>            :       }
<span class="lineNum">     974 </span>            :       m-&gt;unlock_upgrade();
<span class="lineNum">     975 </span>            :       is_locked = false;
<span class="lineNum">     976 </span>            :     }
<span class="lineNum">     977 </span>            : #ifdef BOOST_THREAD_USES_CHRONO
<span class="lineNum">     978 </span>            :     template &lt;class Rep, class Period&gt;
<span class="lineNum">     979 </span>            :     bool try_lock_for(const chrono::duration&lt;Rep, Period&gt;&amp; rel_time)
<span class="lineNum">     980 </span>            :     {
<span class="lineNum">     981 </span>            :       if(m==0)
<span class="lineNum">     982 </span>            :       {
<span class="lineNum">     983 </span>            :         boost::throw_exception(boost::lock_error(static_cast&lt;int&gt;(system::errc::operation_not_permitted), &quot;boost shared_lock has no mutex&quot;));
<span class="lineNum">     984 </span>            :       }
<span class="lineNum">     985 </span>            :       if(owns_lock())
<span class="lineNum">     986 </span>            :       {
<span class="lineNum">     987 </span>            :         boost::throw_exception(boost::lock_error(static_cast&lt;int&gt;(system::errc::resource_deadlock_would_occur), &quot;boost shared_lock owns already the mutex&quot;));
<span class="lineNum">     988 </span>            :       }
<span class="lineNum">     989 </span>            :       is_locked=m-&gt;try_lock_upgrade_for(rel_time);
<span class="lineNum">     990 </span>            :       return is_locked;
<span class="lineNum">     991 </span>            :     }
<span class="lineNum">     992 </span>            :     template &lt;class Clock, class Duration&gt;
<span class="lineNum">     993 </span>            :     bool try_lock_until(const chrono::time_point&lt;Clock, Duration&gt;&amp; abs_time)
<span class="lineNum">     994 </span>            :     {
<span class="lineNum">     995 </span>            :       if(m==0)
<span class="lineNum">     996 </span>            :       {
<span class="lineNum">     997 </span>            :         boost::throw_exception(boost::lock_error(static_cast&lt;int&gt;(system::errc::operation_not_permitted), &quot;boost shared_lock has no mutex&quot;));
<span class="lineNum">     998 </span>            :       }
<span class="lineNum">     999 </span>            :       if(owns_lock())
<span class="lineNum">    1000 </span>            :       {
<span class="lineNum">    1001 </span>            :         boost::throw_exception(boost::lock_error(static_cast&lt;int&gt;(system::errc::resource_deadlock_would_occur), &quot;boost shared_lock owns already the mutex&quot;));
<span class="lineNum">    1002 </span>            :       }
<span class="lineNum">    1003 </span>            :       is_locked=m-&gt;try_lock_upgrade_until(abs_time);
<span class="lineNum">    1004 </span>            :       return is_locked;
<span class="lineNum">    1005 </span>            :     }
<span class="lineNum">    1006 </span>            : #endif
<span class="lineNum">    1007 </span>            : #if defined(BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS)
<span class="lineNum">    1008 </span>            :     typedef void (upgrade_lock::*bool_type)();
<span class="lineNum">    1009 </span>            :     operator bool_type() const BOOST_NOEXCEPT
<span class="lineNum">    1010 </span>            :     {
<span class="lineNum">    1011 </span>            :       return is_locked?&amp;upgrade_lock::lock:0;
<span class="lineNum">    1012 </span>            :     }
<span class="lineNum">    1013 </span>            :     bool operator!() const BOOST_NOEXCEPT
<span class="lineNum">    1014 </span>            :     {
<span class="lineNum">    1015 </span>            :       return !owns_lock();
<span class="lineNum">    1016 </span>            :     }
<span class="lineNum">    1017 </span>            : #else
<span class="lineNum">    1018 </span>            :     explicit operator bool() const BOOST_NOEXCEPT
<span class="lineNum">    1019 </span>            :     {
<span class="lineNum">    1020 </span>            :       return owns_lock();
<span class="lineNum">    1021 </span>            :     }
<span class="lineNum">    1022 </span>            : #endif
<span class="lineNum">    1023 </span>            :     bool owns_lock() const BOOST_NOEXCEPT
<span class="lineNum">    1024 </span>            :     {
<span class="lineNum">    1025 </span>            :       return is_locked;
<span class="lineNum">    1026 </span>            :     }
<span class="lineNum">    1027 </span>            :     friend class shared_lock&lt;Mutex&gt; ;
<span class="lineNum">    1028 </span>            :     friend class unique_lock&lt;Mutex&gt; ;
<span class="lineNum">    1029 </span>            :   };
<span class="lineNum">    1030 </span>            : 
<span class="lineNum">    1031 </span>            :   template&lt;typename Mutex&gt;
<span class="lineNum">    1032 </span>            :   void swap(upgrade_lock&lt;Mutex&gt;&amp; lhs, upgrade_lock&lt;Mutex&gt;&amp; rhs)
<span class="lineNum">    1033 </span>            :   BOOST_NOEXCEPT
<span class="lineNum">    1034 </span>            :   {
<span class="lineNum">    1035 </span>            :     lhs.swap(rhs);
<span class="lineNum">    1036 </span>            :   }
<span class="lineNum">    1037 </span>            : 
<span class="lineNum">    1038 </span>            :   BOOST_THREAD_DCL_MOVABLE_BEG(Mutex) upgrade_lock&lt;Mutex&gt; BOOST_THREAD_DCL_MOVABLE_END
<span class="lineNum">    1039 </span>            : 
<span class="lineNum">    1040 </span>            :   template&lt;typename Mutex&gt;
<span class="lineNum">    1041 </span>            :   unique_lock&lt;Mutex&gt;::unique_lock(BOOST_THREAD_RV_REF_BEG upgrade_lock&lt;Mutex&gt; BOOST_THREAD_RV_REF_END other):
<span class="lineNum">    1042 </span>            :   m(BOOST_THREAD_RV(other).m),is_locked(BOOST_THREAD_RV(other).is_locked)
<span class="lineNum">    1043 </span>            :   {
<span class="lineNum">    1044 </span>            :     if(is_locked)
<span class="lineNum">    1045 </span>            :     {
<span class="lineNum">    1046 </span>            :       m-&gt;unlock_upgrade_and_lock();
<span class="lineNum">    1047 </span>            :     }
<span class="lineNum">    1048 </span>            :     BOOST_THREAD_RV(other).release();
<span class="lineNum">    1049 </span>            :   }
<span class="lineNum">    1050 </span>            : 
<span class="lineNum">    1051 </span>            :   template &lt;class Mutex&gt;
<span class="lineNum">    1052 </span>            :   class upgrade_to_unique_lock
<span class="lineNum">    1053 </span>            :   {
<span class="lineNum">    1054 </span>            :   private:
<span class="lineNum">    1055 </span>            :     upgrade_lock&lt;Mutex&gt;* source;
<span class="lineNum">    1056 </span>            :     unique_lock&lt;Mutex&gt; exclusive;
<span class="lineNum">    1057 </span>            : 
<span class="lineNum">    1058 </span>            :   public:
<span class="lineNum">    1059 </span>            :     typedef Mutex mutex_type;
<span class="lineNum">    1060 </span>            :     BOOST_THREAD_MOVABLE_ONLY( upgrade_to_unique_lock)
<span class="lineNum">    1061 </span>            : 
<span class="lineNum">    1062 </span>            :     explicit upgrade_to_unique_lock(upgrade_lock&lt;Mutex&gt;&amp; m_) :
<span class="lineNum">    1063 </span>            :       source(&amp;m_), exclusive(::boost::move(*source))
<span class="lineNum">    1064 </span>            :     {
<span class="lineNum">    1065 </span>            :     }
<span class="lineNum">    1066 </span>            :     ~upgrade_to_unique_lock()
<span class="lineNum">    1067 </span>            :     {
<span class="lineNum">    1068 </span>            :       if (source)
<span class="lineNum">    1069 </span>            :       {
<span class="lineNum">    1070 </span>            :         *source = BOOST_THREAD_MAKE_RV_REF(upgrade_lock&lt;Mutex&gt; (::boost::move(exclusive)));
<span class="lineNum">    1071 </span>            :       }
<span class="lineNum">    1072 </span>            :     }
<span class="lineNum">    1073 </span>            : 
<span class="lineNum">    1074 </span>            :     upgrade_to_unique_lock(BOOST_THREAD_RV_REF_BEG upgrade_to_unique_lock&lt;Mutex&gt; BOOST_THREAD_RV_REF_END other) BOOST_NOEXCEPT:
<span class="lineNum">    1075 </span>            :     source(BOOST_THREAD_RV(other).source),exclusive(::boost::move(BOOST_THREAD_RV(other).exclusive))
<span class="lineNum">    1076 </span>            :     {
<span class="lineNum">    1077 </span>            :       BOOST_THREAD_RV(other).source=0;
<span class="lineNum">    1078 </span>            :     }
<span class="lineNum">    1079 </span>            : 
<span class="lineNum">    1080 </span>            :     //std-2104 unique_lock move-assignment should not be noexcept
<span class="lineNum">    1081 </span>            :     upgrade_to_unique_lock&amp; operator=(BOOST_THREAD_RV_REF_BEG upgrade_to_unique_lock&lt;Mutex&gt; BOOST_THREAD_RV_REF_END other) //BOOST_NOEXCEPT
<span class="lineNum">    1082 </span>            :     {
<span class="lineNum">    1083 </span>            :       upgrade_to_unique_lock temp(other);
<span class="lineNum">    1084 </span>            :       swap(temp);
<span class="lineNum">    1085 </span>            :       return *this;
<span class="lineNum">    1086 </span>            :     }
<span class="lineNum">    1087 </span>            : 
<span class="lineNum">    1088 </span>            :     void swap(upgrade_to_unique_lock&amp; other)BOOST_NOEXCEPT
<span class="lineNum">    1089 </span>            :     {
<span class="lineNum">    1090 </span>            :       std::swap(source,other.source);
<span class="lineNum">    1091 </span>            :       exclusive.swap(other.exclusive);
<span class="lineNum">    1092 </span>            :     }
<span class="lineNum">    1093 </span>            : 
<span class="lineNum">    1094 </span>            : #if defined(BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS)
<span class="lineNum">    1095 </span>            :     typedef void (upgrade_to_unique_lock::*bool_type)(upgrade_to_unique_lock&amp;);
<span class="lineNum">    1096 </span>            :     operator bool_type() const BOOST_NOEXCEPT
<span class="lineNum">    1097 </span>            :     {
<span class="lineNum">    1098 </span>            :       return exclusive.owns_lock()?&amp;upgrade_to_unique_lock::swap:0;
<span class="lineNum">    1099 </span>            :     }
<span class="lineNum">    1100 </span>            :     bool operator!() const BOOST_NOEXCEPT
<span class="lineNum">    1101 </span>            :     {
<span class="lineNum">    1102 </span>            :       return !owns_lock();
<span class="lineNum">    1103 </span>            :     }
<span class="lineNum">    1104 </span>            : #else
<span class="lineNum">    1105 </span>            :     explicit operator bool() const BOOST_NOEXCEPT
<span class="lineNum">    1106 </span>            :     {
<span class="lineNum">    1107 </span>            :       return owns_lock();
<span class="lineNum">    1108 </span>            :     }
<span class="lineNum">    1109 </span>            : #endif
<span class="lineNum">    1110 </span>            : 
<span class="lineNum">    1111 </span>            :     bool owns_lock() const BOOST_NOEXCEPT
<span class="lineNum">    1112 </span>            :     {
<span class="lineNum">    1113 </span>            :       return exclusive.owns_lock();
<span class="lineNum">    1114 </span>            :     }
<span class="lineNum">    1115 </span>            :     Mutex* mutex() const BOOST_NOEXCEPT
<span class="lineNum">    1116 </span>            :     {
<span class="lineNum">    1117 </span>            :       return exclusive.mutex();
<span class="lineNum">    1118 </span>            :     }
<span class="lineNum">    1119 </span>            :   };
<span class="lineNum">    1120 </span>            : 
<span class="lineNum">    1121 </span>            : BOOST_THREAD_DCL_MOVABLE_BEG(Mutex) upgrade_to_unique_lock&lt;Mutex&gt; BOOST_THREAD_DCL_MOVABLE_END
<span class="lineNum">    1122 </span>            : 
<span class="lineNum">    1123 </span>            : namespace detail
<span class="lineNum">    1124 </span>            : {
<span class="lineNum">    1125 </span>            :   template&lt;typename Mutex&gt;
<span class="lineNum">    1126 </span>            :   class try_lock_wrapper:
<span class="lineNum">    1127 </span>            : private unique_lock&lt;Mutex&gt;
<span class="lineNum">    1128 </span>            :   {
<span class="lineNum">    1129 </span>            :     typedef unique_lock&lt;Mutex&gt; base;
<span class="lineNum">    1130 </span>            :   public:
<span class="lineNum">    1131 </span>            :     BOOST_THREAD_MOVABLE_ONLY(try_lock_wrapper)
<span class="lineNum">    1132 </span>            : 
<span class="lineNum">    1133 </span>            :     try_lock_wrapper()
<span class="lineNum">    1134 </span>            :     {}
<span class="lineNum">    1135 </span>            : 
<span class="lineNum">    1136 </span>            :     explicit try_lock_wrapper(Mutex&amp; m):
<span class="lineNum">    1137 </span>            :     base(m,try_to_lock)
<span class="lineNum">    1138 </span>            :     {}
<span class="lineNum">    1139 </span>            : 
<span class="lineNum">    1140 </span>            :     try_lock_wrapper(Mutex&amp; m_,adopt_lock_t):
<span class="lineNum">    1141 </span>            :     base(m_,adopt_lock)
<span class="lineNum">    1142 </span>            :     {
<span class="lineNum">    1143 </span>            : #if ! defined BOOST_THREAD_PROVIDES_NESTED_LOCKS
<span class="lineNum">    1144 </span>            :       BOOST_ASSERT(is_locked_by_this_thread(m_));
<span class="lineNum">    1145 </span>            : #endif
<span class="lineNum">    1146 </span>            :     }
<span class="lineNum">    1147 </span>            :     try_lock_wrapper(Mutex&amp; m_,defer_lock_t):
<span class="lineNum">    1148 </span>            :     base(m_,defer_lock)
<span class="lineNum">    1149 </span>            :     {}
<span class="lineNum">    1150 </span>            :     try_lock_wrapper(Mutex&amp; m_,try_to_lock_t):
<span class="lineNum">    1151 </span>            :     base(m_,try_to_lock)
<span class="lineNum">    1152 </span>            :     {}
<span class="lineNum">    1153 </span>            : #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
<span class="lineNum">    1154 </span>            :     try_lock_wrapper(BOOST_THREAD_RV_REF(try_lock_wrapper) other):
<span class="lineNum">    1155 </span>            :     base(::boost::move(other))
<span class="lineNum">    1156 </span>            :     {}
<span class="lineNum">    1157 </span>            : 
<span class="lineNum">    1158 </span>            : #elif defined BOOST_THREAD_USES_MOVE
<span class="lineNum">    1159 </span>            :     try_lock_wrapper(BOOST_THREAD_RV_REF(try_lock_wrapper) other):
<span class="lineNum">    1160 </span>            :     base(::boost::move(static_cast&lt;base&amp;&gt;(other)))
<span class="lineNum">    1161 </span>            :     {}
<span class="lineNum">    1162 </span>            : 
<span class="lineNum">    1163 </span>            : #else
<span class="lineNum">    1164 </span>            :     try_lock_wrapper(BOOST_THREAD_RV_REF(try_lock_wrapper) other):
<span class="lineNum">    1165 </span>            :     base(BOOST_THREAD_RV_REF(base)(*other))
<span class="lineNum">    1166 </span>            :     {}
<span class="lineNum">    1167 </span>            : #endif
<span class="lineNum">    1168 </span>            :     try_lock_wrapper&amp; operator=(BOOST_THREAD_RV_REF_BEG try_lock_wrapper&lt;Mutex&gt; BOOST_THREAD_RV_REF_END other)
<span class="lineNum">    1169 </span>            :     {
<span class="lineNum">    1170 </span>            :       try_lock_wrapper temp(other);
<span class="lineNum">    1171 </span>            :       swap(temp);
<span class="lineNum">    1172 </span>            :       return *this;
<span class="lineNum">    1173 </span>            :     }
<span class="lineNum">    1174 </span>            :     void swap(try_lock_wrapper&amp; other)
<span class="lineNum">    1175 </span>            :     {
<span class="lineNum">    1176 </span>            :       base::swap(other);
<span class="lineNum">    1177 </span>            :     }
<span class="lineNum">    1178 </span>            :     void lock()
<span class="lineNum">    1179 </span>            :     {
<span class="lineNum">    1180 </span>            :       base::lock();
<span class="lineNum">    1181 </span>            :     }
<span class="lineNum">    1182 </span>            :     bool try_lock()
<span class="lineNum">    1183 </span>            :     {
<span class="lineNum">    1184 </span>            :       return base::try_lock();
<span class="lineNum">    1185 </span>            :     }
<span class="lineNum">    1186 </span>            :     void unlock()
<span class="lineNum">    1187 </span>            :     {
<span class="lineNum">    1188 </span>            :       base::unlock();
<span class="lineNum">    1189 </span>            :     }
<span class="lineNum">    1190 </span>            :     bool owns_lock() const
<span class="lineNum">    1191 </span>            :     {
<span class="lineNum">    1192 </span>            :       return base::owns_lock();
<span class="lineNum">    1193 </span>            :     }
<span class="lineNum">    1194 </span>            :     Mutex* mutex() const BOOST_NOEXCEPT
<span class="lineNum">    1195 </span>            :     {
<span class="lineNum">    1196 </span>            :       return base::mutex();
<span class="lineNum">    1197 </span>            :     }
<span class="lineNum">    1198 </span>            :     Mutex* release()
<span class="lineNum">    1199 </span>            :     {
<span class="lineNum">    1200 </span>            :       return base::release();
<span class="lineNum">    1201 </span>            :     }
<span class="lineNum">    1202 </span>            : 
<span class="lineNum">    1203 </span>            : #if defined(BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS)
<span class="lineNum">    1204 </span>            :     typedef typename base::bool_type bool_type;
<span class="lineNum">    1205 </span>            :     operator bool_type() const
<span class="lineNum">    1206 </span>            :     {
<span class="lineNum">    1207 </span>            :       return base::operator bool_type();
<span class="lineNum">    1208 </span>            :     }
<span class="lineNum">    1209 </span>            :     bool operator!() const
<span class="lineNum">    1210 </span>            :     {
<span class="lineNum">    1211 </span>            :       return !this-&gt;owns_lock();
<span class="lineNum">    1212 </span>            :     }
<span class="lineNum">    1213 </span>            : #else
<span class="lineNum">    1214 </span>            :     explicit operator bool() const
<span class="lineNum">    1215 </span>            :     {
<span class="lineNum">    1216 </span>            :       return owns_lock();
<span class="lineNum">    1217 </span>            :     }
<span class="lineNum">    1218 </span>            : #endif
<span class="lineNum">    1219 </span>            :   };
<span class="lineNum">    1220 </span>            : 
<span class="lineNum">    1221 </span>            :   template&lt;typename Mutex&gt;
<span class="lineNum">    1222 </span>            :   void swap(try_lock_wrapper&lt;Mutex&gt;&amp; lhs,try_lock_wrapper&lt;Mutex&gt;&amp; rhs)
<span class="lineNum">    1223 </span>            :   {
<span class="lineNum">    1224 </span>            :     lhs.swap(rhs);
<span class="lineNum">    1225 </span>            :   }
<span class="lineNum">    1226 </span>            : }
<span class="lineNum">    1227 </span>            : }
<span class="lineNum">    1228 </span>            : #include &lt;boost/config/abi_suffix.hpp&gt;
<span class="lineNum">    1229 </span>            : 
<span class="lineNum">    1230 </span>            : #endif
</pre>
      </td>
    </tr>
  </table>
  <br>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
    <tr><td class="ruler"><img src="../../../../glass.png" width=3 height=3 alt=""></td></tr>
    <tr><td class="versionInfo">Generated by: <a href="http://ltp.sourceforge.net/coverage/lcov.php" target="_parent">LCOV version 1.12</a></td></tr>
  </table>
  <br>

</body>
</html>
